/**
 * Created by zdx  on 2016/8/26.
 *
 *
 */

define(['controller'],function (c) {

   return {
       islogin:function () {
            if(!c.getToken()){
                c.quit();
            }
       },
       isShowFn:function (p) {
           var userRights=c.getValues("rights").split(",");
           $("[data-rights]",p).each(function () {
               var rights=$(this).attr('data-rights');
               if($.inArray(rights,userRights)==-1){
                   $(this).hide();
               }
           })
       }

   }
});